package day15;

import java.time.DayOfWeek;
import java.time.LocalDate;

public enum MyEnum {
    ONE,TWO,THREE;
    MyEnum(){
        System.out.println("MyEnum");
    }//默认私有
    String name;//成员变量
    public void test() {}//普通方法
    public static void test2(){}  //静态方法
    public static void main(String[] args) {
        //使用  就把枚举当常量用就行了，相当于走构造方法
        MyEnum myEnum1 = MyEnum.ONE;
        MyEnum myEnum2 = MyEnum.TWO;
        MyEnum myEnum3 = MyEnum.THREE;
    }
}

enum MyEnum2{
    AAA("张三",18),BBB;
    String name;
    int age;
    MyEnum2(){
        System.out.println("无参构造");
    }
    MyEnum2(String name,int age){
        System.out.println("有参构造");
        this.name = name;
        this.age=age;
    }
    public static void main(String[] args) {
        MyEnum2 myEnum1 = MyEnum2.AAA;
        MyEnum2 myEnum2 = MyEnum2.BBB;
        LocalDate ld = LocalDate.now();
        DayOfWeek week =  ld.getDayOfWeek();
        switch (week){
            case MONDAY:System.out.println("1");break;
            case TUESDAY:System.out.println("2");break;
            case WEDNESDAY:System.out.println("3");break;
            case THURSDAY:System.out.println("4");break;
            case FRIDAY:System.out.println("5");break;
            case SATURDAY:System.out.println("6");break;
            case SUNDAY:System.out.println("7");break;
        }
    }
}